package com.home.customtest.data

import com.custom.action.core.annotations.*
import com.custom.action.model.ActiveBaseModel
import com.custom.jdbc.handler.BooleanTypeHandler
import com.home.customtest.entity.Province

/**
 * @author XiaoBai
 * @since 2024/4/16 15:06
 *
 */
@DbTable("student", order = 7)
class StudentOnInsertOrUpdate :ActiveBaseModel<StudentOnInsertOrUpdate, Int>() {

    var sex: Boolean? = null

    var phone: String? = null

    @DbKey
    var id: Int? = null

    var name: String? = null

    @DbNotField
    var province: Province? = null

    @DbField("nick_code")
    var nickName: String? = null

    var password: String? = null

    @DbLogic(value = "false", delValue = "true", typeHandler = BooleanTypeHandler::class)
    var stateFlag: Boolean? = null


    override fun insertBefore() {
        // 插入或修改时，在此处修改手机号
        this.phone = "1555429610"
    }

    override fun updateBefore() {
        // 插入或修改时，在此处修改手机号
        this.phone = "1555429612"
    }
}